cmake_minimum_required(VERSION 2.9)
project(comphys)

include_directories("${PROJECT_SOURCE_DIR}/include")

set(CMAKE_BUILD_TYPE Release)

ADD_DEFINITIONS(-DVERBOSE)


#MESSAGE(STATUS "the subdir is ${CMAKE_SOURCE_DIR}/lib/")
#aux_source_directory("${CMAKE_SOURCE_DIR}/lib" DIR_LIB_SRCS)
#FILE(GLOB DIR_LIB_SRCS  RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "./lib/*.cpp")
#MESSAGE(STATUS "the files in subdir is ${DIR_LIB_SRCS}")
#add_library(mylibs ${DIR_LIB_SRCS})

file(GLOB mains RELATIVE ${PROJECT_SOURCE_DIR}/ "*.cpp")

file(GLOB study RELATIVE ${PROJECT_SOURCE_DIR}/ "./c++study/*.cpp")


MESSAGE("mains files are ${mains}")
MESSAGE("study files are ${study}")

foreach(mainf IN LISTS mains)
    string(REPLACE ".cpp" "" mainexe ${mainf})
    add_executable(${mainexe} ${mainf})
#    target_link_libraries(${mainexe} mylibs -lm ) 
endforeach(mainf)

foreach(eachf IN LISTS study)
    string(REPLACE ".cpp" "" studyexe1 ${eachf})
    string(REPLACE "c++study/" "" studyexe ${studyexe1})
    add_executable(${studyexe} ${eachf})
    target_link_libraries(${studyexe} -lm -lstdc++) 
endforeach(eachf)

#set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}) 

#file(COPY plot.py DESTINATION ${PROJECT_BINARY_DIR})